<?php
/**
 * Created by PhpStorm.
 * User: Lin
 * Date: 2017/3/20 0020
 * Time: 下午 12:57
 */
class Payment {

    /**按id查询支付名称
     * @param $paymentId 支付id
     * @return mixed
     */
    static function getPaymentName($paymentId){
        $payment=M('payment')->where('id='.$paymentId)->getField('name');
        return $payment;
    }

    /**按支付状态匹配状态中文名称
     * @param $status 支付状态
     * @return mixed|string
     */
    static function getPaymentStatusName($status){
        $name=constant('PAY_STATUS_'.$status.'_NAME');
        if(empty($name)){
            $name='未支付';
        }
        return $name;
    }
}